package com.cq.hd.system.api;

import com.alibaba.fastjson.JSONObject;
import com.cq.hd.common.entity.hf.*;
import com.cq.hd.common.response.Result;
import com.cq.hd.system.api.dto.HfVerifyDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@FeignClient(value = "hd-o2o-system-service", contextId = "hf-api")
public interface HfApi {

    // 验签
    @PostMapping("/system/hf/verify")
    Result<Boolean> verify(@RequestBody HfVerifyDto hfVerifyDto);

    // 申请单查询
    @GetMapping("/system/hf/basicDataQuery")
    Result<JSONObject> basicDataQuery(@RequestParam("applyNo") String applyNo, @RequestParam("huiFuId") String huiFuId);

    // 上传图片
    @PostMapping(value = "/system/hf/imgUpload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Result<String> imgUpload(@RequestPart("file") MultipartFile file, @RequestParam("type") String type);

    // 企业商户入驻
    @PostMapping("/system/hf/merchantEnt")
    Result<HfBusinessEnterApplyResult> merchantEnt(@RequestBody HfBusinessEnterApply hfBusinessEnterApply);

    // 商户基本信息修改
    @PostMapping("/system/hf/merchantEntUpdate")
    Result<HfBusinessEnterApplyResult> merchantEntUpdate(@RequestBody HfBusinessEnterApply hfBusinessEnterApply);

    // 商户业务开通
    @PostMapping("/system/hf/merchantOpen")
    Result<HfBusinessEnterOpenResult> merchantOpen(@RequestBody HfBusinessEnterApply hfBusinessEnterApply);

    // 子账户开通
    @PostMapping("/system/hf/merchantSettleConfig")
    Result<HfBusinessEnterOpenResult> merchantSettleConfig(@RequestBody HfBusinessEnterApply hfBusinessEnterApply);

    // 个人商户入驻
    @PostMapping("/system/hf/merchantEntIndv")
    Result<HfBusinessEnterApplyResult> merchantEntIndv(@RequestBody HfBusinessEnterApply hfBusinessEnterApply);

    // 聚合正扫支付
    @PostMapping("/system/hf/jsPay")
    Result<JSONObject> jsPay(@RequestBody HfJsPay hfJsPay);

    // 商户详细信息查询（查询合同签约状态）
    @PostMapping("/system/hf/merchantBasicDataQuery")
    Result<JSONObject> merchantBasicDataQuery(@RequestParam("hfMerchantNo") String hfMerchantNo);

    // 微信实名认证状态查询
    @PostMapping("/system/hf/wxBusinessRealQuery")
    Result<JSONObject> wxBusinessRealQuery(@RequestParam("hfMerchantNo") String hfMerchantNo);

    // 微信商户配置
    @PostMapping("/system/hf/wxBusinessConfig")
    Result<JSONObject> wxBusinessConfig(@RequestParam("hfMerchantNo") String hfMerchantNo);

    // 微信小程序预下单
    @PostMapping("/system/hf/preOrder")
    Result<JSONObject> preOrder(@RequestBody HfJsPay hfJsPay);

    // 交易查询
    @PostMapping("/system/hf/tradeQuery")
    Result<JSONObject> tradeQuery(@RequestBody HfTradeQuery hfTradeQuery);

    // 交易退款
    @PostMapping("/system/hf/tradeRefund")
    Result<JSONObject> tradeRefund(@RequestBody HfTradeRefund hfTradeRefund);

    // 交易退款查询
    @PostMapping("/system/hf/tradeRefundQuery")
    Result<JSONObject> tradeRefundQuery(@RequestBody HfTradeRefundQuery hfTradeRefundQuery);

    // 个人用户开户
    @PostMapping("/system/hf/agentUserInvite")
    Result<JSONObject> agentUserInvite(@RequestBody HfAgentUserEnterApply hfAgentUserEnterApply);

    // 个人用户业务入驻
    @PostMapping("/system/hf/agentUserOpen")
    Result<JSONObject> agentUserOpen(@RequestBody HfAgentUserEnterApply hfAgentUserEnterApply);

    // 用户业务查询
    @PostMapping("/system/hf/agentUserQuery")
    Result<JSONObject> agentUserQuery(@RequestParam("hfId") String hfId);

    // 商户签约查询
    @PostMapping("/system/hf/merchantSignQuery")
    Result<JSONObject> merchantSignQuery();

    // 个人签约发起
    @PostMapping("/system/hf/agentSignCreate")
    Result<JSONObject> agentSignCreate(@RequestBody HfAgentUserSignCreate hfAgentUserSignCreate);

    @PostMapping("/system/hf/agentSignQuery")
    Result<JSONObject> agentSignQuery(@RequestParam("contractId") String contractId);

    // 余额支付（给商户分本金）
    @PostMapping("/system/hf/tradeAccountAmtPay")
    Result<JSONObject> tradeAccountAmtPay(@RequestBody HfTradeAccountPay hfTradeAccountPay);

    // 余额支付查询
    @PostMapping("/system/hf/tradeAccountAmtQuery")
    Result<JSONObject> tradeAccountAmtQuery(@RequestBody HfTradeAccountPay hfTradeAccountPay);

    // 补贴支付（给商户分补贴）
    @PostMapping("/system/hf/tradeMarketTransferPay")
    Result<JSONObject> tradeMarketTransferPay(@RequestBody HfTradeMarketPay hfTradeMarketPay);

    // 补贴转账查询
    @PostMapping("/system/hf/tradeMarketTransferQuery")
    Result<JSONObject> tradeMarketTransferQuery(@RequestBody HfTradeMarketPay hfTradeMarketPay);

    // 结算提现
    @PostMapping("/system/hf/settlement")
    Result<JSONObject> settlement(@RequestBody HfSettlement hfSettlement);

    // 结算提现查询
    @PostMapping("/system/hf/settlementQuery")
    Result<JSONObject> settlementQuery(@RequestBody HfSettlement hfSettlement);

    // 开票类目查询
    @PostMapping("/system/hf/hycInvCategoryQuery")
    Result<JSONObject> hycInvCategoryQuery(@RequestParam("minorAgentId") String minorAgentId);

    // 申请开票（灵活用工）
    @PostMapping("/system/hf/hycInvApply")
    Result<HfInvApply> hycInvApply(@RequestBody HfInvApply hfInvApply);

    // 开票信息查询
    @PostMapping("/system/hf/hycInvQuery")
    Result<JSONObject> hycInvQuery(@RequestBody HfInvApply hfInvApply);

    // 网银支付
    @PostMapping("/system/hf/bankPay")
    Result<JSONObject> bankPay(@RequestBody HfBankPay hfBankPay);

    // 线上交易查询
    @PostMapping("/system/hf/bankPayQuery")
    Result<JSONObject> bankPayQuery(@RequestBody HfTradeQuery hfTradeQuery);

    // 用户业务入驻修改
    @PostMapping("/system/hf/agentUserModify")
    Result<JSONObject> agentUserModify(@RequestBody HfAgentUserEnterApply hfAgentUserEnterApply);

    // 账户余额信息查询
    @PostMapping("/system/hf/acctBalanceQuery")
    Result<JSONObject> acctBalanceQuery(@RequestParam("hfId") String hfId);

    // 用户信息查询
    @PostMapping("/system/hf/userBasicDataQuery")
    Result<JSONObject> userBasicDataQuery(@RequestParam("hfId") String hfId);

    // 修改子账户配置
    @PostMapping("/system/hf/merchantSettleModify")
    Result<JSONObject> merchantSettleModify(@RequestBody HfBusinessEnterApply hfBusinessEnterApply);
}
